package com.moli.iov.base.model;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.moli.iov.base.model.po.CompanyVehicleModel;
import com.moli.iov.base.util.CollectionUtils;
import java.util.List;
import org.apache.commons.lang3.StringUtils;

/**
 * @author whl
 */
public class CompanyVehicleModelParam {
  private QueryWrapper<CompanyVehicleModel> queryWrapper;

  public CompanyVehicleModelParam(){
    queryWrapper = new QueryWrapper<>();
    queryWrapper.eq("is_delete",0);

  }

  public QueryWrapper<CompanyVehicleModel> get(){
    return queryWrapper;
  }
  public CompanyVehicleModelParam queryEqCompanyName(String companyName){
    if (StringUtils.isNotEmpty(companyName)){
      queryWrapper.eq("company_name",companyName);
    }
    return this;
  }

  public CompanyVehicleModelParam queryEqDeviceModel(String deviceModel){
    if (StringUtils.isNotEmpty(deviceModel)){
      queryWrapper.eq("device_model",deviceModel);
    }
    return this;
  }

  public CompanyVehicleModelParam queryEqCompanyVehicleModel(String vehicleModel){
    if (StringUtils.isNotEmpty(vehicleModel)){
      queryWrapper.eq("vehicle_model",vehicleModel);
    }
    return this;
  }


  public CompanyVehicleModelParam queryEqSupplierName(String supplierName){
    if (StringUtils.isNotEmpty(supplierName)){
      queryWrapper.eq("supplier_name",supplierName);
    }
    return this;

  }  public CompanyVehicleModelParam queryInIdList(List<Long> idList){
    if (!CollectionUtils.isEmpty(idList)){
      queryWrapper.in("id",idList);
    }
    return this;
  }

  public CompanyVehicleModelParam queryEqCompanyId(Long companyId){
    if (companyId!=null){
      queryWrapper.eq("company_id",companyId);
    }
    return this;
  }
  public CompanyVehicleModelParam gmtModifiedOrderByDesc(){
    queryWrapper.orderByDesc("gmt_modified");
    return this;
  }




}
